package day012.homework.p4;

import java.util.Objects;

public class Student {
    private String name;
    private String sex;
    private int age;

    @Override
    public String toString() {
        return name + ", " + sex + ", " + age;
    }

    @Override
    public boolean equals(Object obj) {
    if (!(obj instanceof Student)) {
        return false;
    }

    if (this.getClass() != obj.getClass()) {
        return false;
    }

    Student student = (Student) obj;
    return Objects.equals(this.name, student.getName()) &&
           Objects.equals(this.sex, student.getSex()) &&
           this.age == student.getAge();
}


    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }
}
